package kamikaze.support;

import javax.servlet.http.HttpServletRequest;

public class MessageView {

	private HttpServletRequest request;

	private MessageView(HttpServletRequest request) {
		this.request = request;
	}

	public static MessageView from(ServiceContext ctx) {
		return new MessageView(ctx.getRequest());
	}

	public MessageView setMessage(String message) {
		request.setAttribute("message", message);
		return this;
	}

	public MessageView setNextURL(String url) {
		request.setAttribute("nextURL", url);
		return this;
	}

	public String getViewName() {
		return "message";
	}
}
